package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.model.V;
import com.villaday.idf.model2.Home_configurations;
import com.villaday.idf.model3.DataEntity;
import com.villaday.idf.model3.HomeDetailsEntity;

public class HomeCityAdapter extends AbsRecyclerViewAdapter<HomeDetailsEntity.BodyBean.DestinationsBean> {

    public HomeCityAdapter(Context context) {
        super(context, R.layout.recycle_home_city);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, HomeDetailsEntity.BodyBean.DestinationsBean d, int position) {
        try {
            if (position < 3) {
                holder.getView(R.id.tv_city).setVisibility(View.GONE);
                holder.getView(R.id.sdv_city).setVisibility(View.VISIBLE);
                holder.bindSimpleDraweeView(R.id.sdv_city, d.getMaterial().getUrl());
            } else {
                holder.getView(R.id.sdv_city).setVisibility(View.GONE);
                holder.getView(R.id.tv_city).setVisibility(View.VISIBLE);
                holder.bindTextView(R.id.tv_city, d.getName());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}